package com.slz3.business.module.configManagement.conVersion.steward;

import com.slz3.business.module.configManagement.conVersion.domain.ConVersion;
import com.slz3.business.module.configManagement.conVersion.domain.ConVersionCondition;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

@Component
public class ConVersionResponse {

    @Autowired
    private ConVersionResController controller;

    public  Mono<ServerResponse> add(ServerRequest req) {
        return req.bodyToMono(ConVersion.class).flatMap(conVersion ->
                controller.add(req, conVersion)
        );
    }

    public  Mono<ServerResponse> delete(ServerRequest req) {
        return req.bodyToMono(ConVersionCondition.class).flatMap(conVersionCondition ->
                controller.delete(req, conVersionCondition)
        );
    }

    public  Mono<ServerResponse> modify(ServerRequest req) {
        return req.bodyToMono(ConVersion.class).flatMap(conVersion ->
                controller.modify(req, conVersion)
        );
    }


    public  Mono<ServerResponse> list(ServerRequest req) {
        return controller.list(req);
    }

    public  Mono<ServerResponse> info(ServerRequest req) {
        return controller.info(req);
    }

    public  Mono<ServerResponse> choice(ServerRequest req) {
        return controller.choice(req);
    }

    public  Mono<ServerResponse> auditSubmit(ServerRequest req) {
        return req.bodyToMono(ConVersionCondition.class).flatMap(conVersionCondition ->
                controller.auditSubmit(req, conVersionCondition)
        );
    }

    public  Mono<ServerResponse> audit(ServerRequest req) {
        return req.bodyToMono(ConVersionCondition.class).flatMap(conVersionCondition ->
                controller.audit(req, conVersionCondition)
        );
    }

    public  Mono<ServerResponse> auditReject(ServerRequest req) {
        return req.bodyToMono(ConVersionCondition.class).flatMap(conVersionCondition ->
                controller.auditReject(req, conVersionCondition)
        );
    }

    public  Mono<ServerResponse> usingEnable(ServerRequest req) {
        return req.bodyToMono(ConVersionCondition.class).flatMap(conVersionCondition ->
                controller.usingEnable(req, conVersionCondition)
        );
    }

    public  Mono<ServerResponse> usingDisable(ServerRequest req) {
        return req.bodyToMono(ConVersionCondition.class).flatMap(conVersionCondition ->
                controller.usingDisable(req, conVersionCondition)
        );
    }   

}
